/* ptw.t   ITEM MASTER WRITE TRIGGER                                  */

TRIGGER PROCEDURE FOR WRITE OF PT_MSTR OLD BUFFER OLD_PT_MSTR.

/*J12B  if not can-find(first whl_mstr where whl_mstr.whl_act no-lock) */
/*J12B  then leave. */

        {mfdeclre.i }
        define new shared work-table wf_old_pt_mstr like pt_mstr.
        define new shared variable w-recid as recid.
/*J12B*/define new shared variable w-site-loc-id like whl_mstr.whl_src_dest_id.
        define variable w-file as character format "x(24)".

        /* Warehousing Interface processing */

        WI:
        do:

        /* If there is no active external warehouse, then do not process */
/*K01B     If the item extract flag is not set, then do not process */
/*J12B*/    if not can-find(first whl_mstr no-lock
/*K01B  /*J12B*/          where whl_mstr.whl_act) */
/*K01B*/        where whl_mstr.whl_act
/*K01B*/        and whl_mstr.whl_pt_exp)
/*J12B*/    then leave WI.

        /* If no pertinent fields have been changed, then do not process */
/*J12B*/    if (old_pt_mstr.pt_part           = pt_mstr.pt_part
/*J12B*/      and old_pt_mstr.pt_desc1        = pt_mstr.pt_desc1
/*J12B*/      and old_pt_mstr.pt_desc2        = pt_mstr.pt_desc2
/*J12B*/      and old_pt_mstr.pt_fr_class     = pt_mstr.pt_fr_class
/*J12B*/      and old_pt_mstr.pt_height       = pt_mstr.pt_height
/*J12B*/      and old_pt_mstr.pt_insp_rqd     = pt_mstr.pt_insp_rqd
/*J12B*/      and old_pt_mstr.pt_length       = pt_mstr.pt_length
/*J12B*/      and old_pt_mstr.pt_lot_ser      = pt_mstr.pt_lot_ser
/*J12B*/      and old_pt_mstr.pt_net_wt       = pt_mstr.pt_net_wt
/*J12B*/      and old_pt_mstr.pt_net_wt_um    = pt_mstr.pt_net_wt_um
/*J12B*/      and old_pt_mstr.pt_rctpo_status = pt_mstr.pt_rctpo_status
/*J12B*/      and old_pt_mstr.pt_rev          = pt_mstr.pt_rev
/*J12B*/      and old_pt_mstr.pt_rop          = pt_mstr.pt_rop
/*J12B*/      and old_pt_mstr.pt_sfty_stk     = pt_mstr.pt_sfty_stk
/*J12B*/      and old_pt_mstr.pt_shelflife    = pt_mstr.pt_shelflife
/*J12B*/      and old_pt_mstr.pt_ship_wt      = pt_mstr.pt_ship_wt
/*J12B*/      and old_pt_mstr.pt_ship_wt_um   = pt_mstr.pt_ship_wt_um
/*J12B*/      and old_pt_mstr.pt_size         = pt_mstr.pt_size
/*J12B*/      and old_pt_mstr.pt_status       = pt_mstr.pt_status
/*J12B*/      and old_pt_mstr.pt_cyc_int      = pt_mstr.pt_cyc_int
/*J12B*/      and old_pt_mstr.pt_loc_type     = pt_mstr.pt_loc_type
/*J12B*/      and old_pt_mstr.pt_article      = pt_mstr.pt_article
/*J12B*/      and old_pt_mstr.pt_um           = pt_mstr.pt_um
/*J12B*/      and old_pt_mstr.pt_user1        = pt_mstr.pt_user1
/*J12B*/      and old_pt_mstr.pt_user2        = pt_mstr.pt_user2
/*J12B*/      and old_pt_mstr.pt_width        = pt_mstr.pt_width
/*J12B*/      and old_pt_mstr.pt_vend         = pt_mstr.pt_vend)
/*J12B*/    then leave WI.

        /* Move old pt_mstr values to work table for subsequent processing */
            assign w-recid = recid(pt_mstr).
            create wf_old_pt_mstr.
            if recid(wf_old_pt_mstr)= -1 then .
            assign
                wf_old_pt_mstr.pt_part         = old_pt_mstr.pt_part
                wf_old_pt_mstr.pt_desc1        = old_pt_mstr.pt_desc1
                wf_old_pt_mstr.pt_desc2        = old_pt_mstr.pt_desc2
                wf_old_pt_mstr.pt_fr_class     = old_pt_mstr.pt_fr_class
                wf_old_pt_mstr.pt_height       = old_pt_mstr.pt_height
                wf_old_pt_mstr.pt_insp_rqd     = old_pt_mstr.pt_insp_rqd
                wf_old_pt_mstr.pt_length       = old_pt_mstr.pt_length
                wf_old_pt_mstr.pt_lot_ser      = old_pt_mstr.pt_lot_ser
                wf_old_pt_mstr.pt_net_wt       = old_pt_mstr.pt_net_wt
                wf_old_pt_mstr.pt_net_wt_um    = old_pt_mstr.pt_net_wt_um
                wf_old_pt_mstr.pt_rctpo_status = old_pt_mstr.pt_rctpo_status
                wf_old_pt_mstr.pt_rev          = old_pt_mstr.pt_rev
                wf_old_pt_mstr.pt_rop          = old_pt_mstr.pt_rop
                wf_old_pt_mstr.pt_sfty_stk     = old_pt_mstr.pt_sfty_stk
                wf_old_pt_mstr.pt_shelflife    = old_pt_mstr.pt_shelflife
                wf_old_pt_mstr.pt_ship_wt      = old_pt_mstr.pt_ship_wt
                wf_old_pt_mstr.pt_ship_wt_um   = old_pt_mstr.pt_ship_wt_um
                wf_old_pt_mstr.pt_size         = old_pt_mstr.pt_size
                wf_old_pt_mstr.pt_status       = old_pt_mstr.pt_status
                wf_old_pt_mstr.pt_cyc_int      = old_pt_mstr.pt_cyc_int
                wf_old_pt_mstr.pt_loc_type     = old_pt_mstr.pt_loc_type
                wf_old_pt_mstr.pt_article      = old_pt_mstr.pt_article
                wf_old_pt_mstr.pt_um           = old_pt_mstr.pt_um
                wf_old_pt_mstr.pt_user1        = old_pt_mstr.pt_user1
                wf_old_pt_mstr.pt_user2        = old_pt_mstr.pt_user2
                wf_old_pt_mstr.pt_width        = old_pt_mstr.pt_width
/*J10D*/        wf_old_pt_mstr.pt_vend         = old_pt_mstr.pt_vend
            .

        /* Call subprogram to create export transactions for warehouses */
            w-file = "wiptw.p".
/*J1DM*/ /* {gprun.i ""wiptw.p""} */
/*J1DM*/    {gprunmo.i &module="WI"
                       &program="wiptw.p"}

/*J12B*/end. /* WI */
/*M00M*//* Logistics Interface processing */
/*M00M*/LG:
/*M00M*/do:
/*M00M*//* If there is no logistics application ID, then do not process */
/*M00M*/         if not can-find(first lgs_mstr no-lock
/*M00M*/           where lgs_app_id <> "")
/*M00M*/           then leave LG.
/*M00M*//* If pt_status has changed, then do process */
/*M00M*/   if (old_pt_mstr.pt_status <> pt_mstr.pt_status) then do:
/*M00M*//* Move old pt_mstr values to work table for subsequent processing */
/*M00M*/      if not can-find ( first wf_old_pt_mstr ) then do:
/*M00M*/         create wf_old_pt_mstr.
/*M00M*/         if recid(wf_old_pt_mstr)= -1 then .
/*M00M*/      end.
/*M00M*/      buffer-copy old_pt_mstr to wf_old_pt_mstr no-error.
/*M00M*//* Call subprogram to publish changed status for Logistics */
/*M00M*/      {gprunmo.i &module="LG"
/*M00M*/      &program="lgckist.p"
/*M00M*/      &param="""(input recid(pt_mstr))"""}
/*M00M*/   end.
/*M00M*/end. /* LG */
/*M00M* *End of Added Section */


/* fdn 2004/10/28 Modify Record processing */
HK:
do:
    if can-find(first dt_mstr where dt_table = "pt_mstr" and dt_type = "SYNC") then
        run CreateSyncFlag(input "MOD", input recid(pt_mstr), input "pt_mstr").

    if not can-find ( first dt_mstr where dt_table = "pt_mstr" and dt_type = "MOD" ) then leave HK.
    
    if not can-find ( first wf_old_pt_mstr ) then do:
        create wf_old_pt_mstr.
        if recid(wf_old_pt_mstr)= -1 then .
    end.
    
    buffer-copy old_pt_mstr to wf_old_pt_mstr no-error.

    for each dt_mstr no-lock where dt_table = "pt_mstr" and dt_type = "MOD" :
    
        case dt_field :

            when "pt_part" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_part, input pt_mstr.pt_part,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_desc1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_desc1, input pt_mstr.pt_desc1,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_desc2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_desc2, input pt_mstr.pt_desc2,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_um, input pt_mstr.pt_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad13" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__qad13, input pt_mstr.pt__qad13,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad12" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad12), input string(pt_mstr.pt__qad12),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_draw" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_draw, input pt_mstr.pt_draw,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_prod_line" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_prod_line, input pt_mstr.pt_prod_line,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_group" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_group, input pt_mstr.pt_group,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_part_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_part_type, input pt_mstr.pt_part_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_status" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_status, input pt_mstr.pt_status,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_abc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_abc, input pt_mstr.pt_abc,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_iss_pol" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_iss_pol), input string(pt_mstr.pt_iss_pol),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_phantom" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_phantom), input string(pt_mstr.pt_phantom),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_loc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_loc, input pt_mstr.pt_loc,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad01), input string(pt_mstr.pt__qad01),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad02), input string(pt_mstr.pt__qad02),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_abc_amt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_abc_amt), input string(pt_mstr.pt_abc_amt),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad03), input string(pt_mstr.pt__qad03),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad04), input string(pt_mstr.pt__qad04),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_avg_int" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_avg_int), input string(pt_mstr.pt_avg_int),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad05), input string(pt_mstr.pt__qad05),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_cyc_int" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_cyc_int), input string(pt_mstr.pt_cyc_int),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad06" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad06), input string(pt_mstr.pt__qad06),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad07" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad07), input string(pt_mstr.pt__qad07),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad08" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad08), input string(pt_mstr.pt__qad08),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ms" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ms), input string(pt_mstr.pt_ms),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_plan_ord" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_plan_ord), input string(pt_mstr.pt_plan_ord),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mrp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mrp), input string(pt_mstr.pt_mrp),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_pol" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ord_pol, input pt_mstr.pt_ord_pol,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_qty" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ord_qty), input string(pt_mstr.pt_ord_qty),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_per" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ord_per), input string(pt_mstr.pt_ord_per),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_sfty_stk" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_sfty_stk), input string(pt_mstr.pt_sfty_stk),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_sfty_time" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_sfty_time), input string(pt_mstr.pt_sfty_time),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rop" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_rop), input string(pt_mstr.pt_rop),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_buyer" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_buyer, input pt_mstr.pt_buyer,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_vend" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_vend, input pt_mstr.pt_vend,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad09" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad09), input string(pt_mstr.pt__qad09),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pm_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pm_code, input pt_mstr.pt_pm_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mfg_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mfg_lead), input string(pt_mstr.pt_mfg_lead),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pur_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_pur_lead), input string(pt_mstr.pt_pur_lead),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_insp_rqd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_insp_rqd), input string(pt_mstr.pt_insp_rqd),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_insp_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_insp_lead), input string(pt_mstr.pt_insp_lead),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_cum_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_cum_lead), input string(pt_mstr.pt_cum_lead),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_min" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ord_min), input string(pt_mstr.pt_ord_min),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_max" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ord_max), input string(pt_mstr.pt_ord_max),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ord_mult" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ord_mult), input string(pt_mstr.pt_ord_mult),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_yield_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_yield_pct), input string(pt_mstr.pt_yield_pct),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad16" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad16), input string(pt_mstr.pt__qad16),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_setup" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_setup), input string(pt_mstr.pt_setup),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_setup_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_setup_ll), input string(pt_mstr.pt_setup_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_run_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_run_ll), input string(pt_mstr.pt_run_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_run" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_run), input string(pt_mstr.pt_run),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_price" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_price), input string(pt_mstr.pt_price),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xmtl_tl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xmtl_tl), input string(pt_mstr.pt_xmtl_tl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xlbr_tl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xlbr_tl), input string(pt_mstr.pt_xlbr_tl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xbdn_tl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xbdn_tl), input string(pt_mstr.pt_xbdn_tl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xsub_tl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xsub_tl), input string(pt_mstr.pt_xsub_tl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xmtl_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xmtl_ll), input string(pt_mstr.pt_xmtl_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xlbr_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xlbr_ll), input string(pt_mstr.pt_xlbr_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xbdn_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xbdn_ll), input string(pt_mstr.pt_xbdn_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xsub_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xsub_ll), input string(pt_mstr.pt_xsub_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xtot_cur" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xtot_cur), input string(pt_mstr.pt_xtot_cur),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_cur_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_cur_date), input string(pt_mstr.pt_cur_date),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xmtl_stdtl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xmtl_stdtl), input string(pt_mstr.pt_xmtl_stdtl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xlbr_stdtl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xlbr_stdtl), input string(pt_mstr.pt_xlbr_stdtl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xbdn_stdtl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xbdn_stdtl), input string(pt_mstr.pt_xbdn_stdtl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xsub_stdtl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xsub_stdtl), input string(pt_mstr.pt_xsub_stdtl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xtot_std" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xtot_std), input string(pt_mstr.pt_xtot_std),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_std_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_std_date), input string(pt_mstr.pt_std_date),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ll_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ll_code), input string(pt_mstr.pt_ll_code),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_abc_qty" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_abc_qty), input string(pt_mstr.pt_abc_qty),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad10" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad10), input string(pt_mstr.pt__qad10),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad11" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad11), input string(pt_mstr.pt__qad11),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_routing" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_routing, input pt_mstr.pt_routing,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_lot_ser" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_lot_ser, input pt_mstr.pt_lot_ser,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_timefence" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_timefence), input string(pt_mstr.pt_timefence),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xmtl_stdll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xmtl_stdll), input string(pt_mstr.pt_xmtl_stdll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xlbr_stdll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xlbr_stdll), input string(pt_mstr.pt_xlbr_stdll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xbdn_stdll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xbdn_stdll), input string(pt_mstr.pt_xbdn_stdll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xsub_stdll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xsub_stdll), input string(pt_mstr.pt_xsub_stdll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rev" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rev, input pt_mstr.pt_rev,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_last_eco" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_last_eco), input string(pt_mstr.pt_last_eco),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad15" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad15), input string(pt_mstr.pt__qad15),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad17" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad17), input string(pt_mstr.pt__qad17),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_qc_lead" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_qc_lead), input string(pt_mstr.pt_qc_lead),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_auto_lot" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_auto_lot), input string(pt_mstr.pt_auto_lot),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_assay" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_assay), input string(pt_mstr.pt_assay),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_batch" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_batch), input string(pt_mstr.pt_batch),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad14" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad14), input string(pt_mstr.pt__qad14),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_user3" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_user3, input pt_mstr.pt_user3,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_user1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_user1, input pt_mstr.pt_user1,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_user2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_user2, input pt_mstr.pt_user2,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_net_wt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_net_wt), input string(pt_mstr.pt_net_wt),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_net_wt_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_net_wt_um, input pt_mstr.pt_net_wt_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_size" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_size), input string(pt_mstr.pt_size),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_size_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_size_um, input pt_mstr.pt_size_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_taxable" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_taxable), input string(pt_mstr.pt_taxable),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_taxc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_taxc, input pt_mstr.pt_taxc,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rollup" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_rollup), input string(pt_mstr.pt_rollup),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xovh_ll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xovh_ll), input string(pt_mstr.pt_xovh_ll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xovh_tl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xovh_tl), input string(pt_mstr.pt_xovh_tl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xovh_stdll" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xovh_stdll), input string(pt_mstr.pt_xovh_stdll),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_xovh_stdtl" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_xovh_stdtl), input string(pt_mstr.pt_xovh_stdtl),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_site" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_site, input pt_mstr.pt_site,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_shelflife" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_shelflife), input string(pt_mstr.pt_shelflife),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_critical" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_critical), input string(pt_mstr.pt_critical),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_sngl_lot" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_sngl_lot), input string(pt_mstr.pt_sngl_lot),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_upc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_upc, input pt_mstr.pt_upc,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_hazard" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_hazard, input pt_mstr.pt_hazard,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_added" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_added), input string(pt_mstr.pt_added),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr01, input pt_mstr.pt__chr01,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr02, input pt_mstr.pt__chr02,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr03" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr03, input pt_mstr.pt__chr03,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr04" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr04, input pt_mstr.pt__chr04,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr05" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr05, input pt_mstr.pt__chr05,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr06" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr06, input pt_mstr.pt__chr06,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr07" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr07, input pt_mstr.pt__chr07,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr08" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr08, input pt_mstr.pt__chr08,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr09" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr09, input pt_mstr.pt__chr09,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__chr10" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt__chr10, input pt_mstr.pt__chr10,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__dte01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__dte01), input string(pt_mstr.pt__dte01),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__dte02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__dte02), input string(pt_mstr.pt__dte02),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__dec01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__dec01), input string(pt_mstr.pt__dec01),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__dec02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__dec02), input string(pt_mstr.pt__dec02),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__log01" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__log01), input string(pt_mstr.pt__log01),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__log02" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__log02), input string(pt_mstr.pt__log02),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad18" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad18), input string(pt_mstr.pt__qad18),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad21" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad21), input string(pt_mstr.pt__qad21),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad19" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad19), input string(pt_mstr.pt__qad19),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad20" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad20), input string(pt_mstr.pt__qad20),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_length" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_length), input string(pt_mstr.pt_length),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_height" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_height), input string(pt_mstr.pt_height),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_width" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_width), input string(pt_mstr.pt_width),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_dim_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_dim_um, input pt_mstr.pt_dim_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pkg_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pkg_code, input pt_mstr.pt_pkg_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_network" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_network, input pt_mstr.pt_network,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ll_drp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ll_drp), input string(pt_mstr.pt_ll_drp),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_fr_class" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_fr_class, input pt_mstr.pt_fr_class,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_spec_hdlg" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_spec_hdlg, input pt_mstr.pt_spec_hdlg,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_bom_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_bom_code, input pt_mstr.pt_bom_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_loc_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_loc_type, input pt_mstr.pt_loc_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_transtype" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_transtype, input pt_mstr.pt_transtype,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_cover" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_cover, input pt_mstr.pt_cover,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_unit_isb" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_unit_isb), input string(pt_mstr.pt_unit_isb),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_article" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_article, input pt_mstr.pt_article,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_po_site" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_po_site, input pt_mstr.pt_po_site,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ship_wt" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ship_wt), input string(pt_mstr.pt_ship_wt),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ship_wt_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ship_wt_um, input pt_mstr.pt_ship_wt_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_formula" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_formula), input string(pt_mstr.pt_formula),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_dea" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_dea), input string(pt_mstr.pt_dea),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad26" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad26), input string(pt_mstr.pt__qad26),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad22" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad22), input string(pt_mstr.pt__qad22),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad25" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad25), input string(pt_mstr.pt__qad25),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad24" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad24), input string(pt_mstr.pt__qad24),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt__qad23" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt__qad23), input string(pt_mstr.pt__qad23),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_comm_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_comm_code, input pt_mstr.pt_comm_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_inst_call" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_inst_call), input string(pt_mstr.pt_inst_call),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_sys_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_sys_type, input pt_mstr.pt_sys_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_tariff" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_tariff, input pt_mstr.pt_tariff,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_origin" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_origin, input pt_mstr.pt_origin,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_sttr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_sttr), input string(pt_mstr.pt_sttr),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mfg_mtbf" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mfg_mtbf), input string(pt_mstr.pt_mfg_mtbf),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mfg_mttr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mfg_mttr), input string(pt_mstr.pt_mfg_mttr),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_fru" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_fru), input string(pt_mstr.pt_fru),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ven_warr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_ven_warr), input string(pt_mstr.pt_ven_warr),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_svc_group" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_svc_group, input pt_mstr.pt_svc_group,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_svc_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_svc_type, input pt_mstr.pt_svc_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mtbf" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mtbf), input string(pt_mstr.pt_mtbf),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mttr" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mttr), input string(pt_mstr.pt_mttr),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_isb" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_isb), input string(pt_mstr.pt_isb),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pvm_days" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_pvm_days), input string(pt_mstr.pt_pvm_days),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_warr_cd" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_warr_cd, input pt_mstr.pt_warr_cd,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mod_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mod_date), input string(pt_mstr.pt_mod_date),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_userid" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_userid, input pt_mstr.pt_userid,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_obs_date" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_obs_date), input string(pt_mstr.pt_obs_date),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pvm_bom" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pvm_bom, input pt_mstr.pt_pvm_bom,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pvm_route" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pvm_route, input pt_mstr.pt_pvm_route,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pvm_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pvm_um, input pt_mstr.pt_pvm_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rp_bom" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rp_bom, input pt_mstr.pt_rp_bom,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rp_route" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rp_route, input pt_mstr.pt_rp_route,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rp_vendor" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rp_vendor, input pt_mstr.pt_rp_vendor,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rctpo_status" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rctpo_status, input pt_mstr.pt_rctpo_status,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rollup_id" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rollup_id, input pt_mstr.pt_rollup_id,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_spec_grav" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_spec_grav), input string(pt_mstr.pt_spec_grav),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_joint_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_joint_type, input pt_mstr.pt_joint_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_mfg_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_mfg_pct), input string(pt_mstr.pt_mfg_pct),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pur_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_pur_pct), input string(pt_mstr.pt_pur_pct),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_drp_pct" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_drp_pct), input string(pt_mstr.pt_drp_pct),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pou_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_pou_code, input pt_mstr.pt_pou_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_wks_avg" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_wks_avg), input string(pt_mstr.pt_wks_avg),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_wks_max" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_wks_max), input string(pt_mstr.pt_wks_max),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_wks_min" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_wks_min), input string(pt_mstr.pt_wks_min),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pick_logic" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_pick_logic), input string(pt_mstr.pt_pick_logic),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_fiscal_class" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_fiscal_class, input pt_mstr.pt_fiscal_class,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_dsgn_grp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_dsgn_grp, input pt_mstr.pt_dsgn_grp,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_drwg_loc" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_drwg_loc, input pt_mstr.pt_drwg_loc,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ecn_rev" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ecn_rev, input pt_mstr.pt_ecn_rev,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_drwg_size" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_drwg_size, input pt_mstr.pt_drwg_size,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_model" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_model, input pt_mstr.pt_model,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_repairable" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_repairable), input string(pt_mstr.pt_repairable),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rctwo_status" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_rctwo_status, input pt_mstr.pt_rctwo_status,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_lot_grp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_lot_grp, input pt_mstr.pt_lot_grp,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rctpo_active" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_rctpo_active), input string(pt_mstr.pt_rctpo_active),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_rctwo_active" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_rctwo_active), input string(pt_mstr.pt_rctwo_active),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_break_cat" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_break_cat, input pt_mstr.pt_break_cat,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_fsc_code" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_fsc_code, input pt_mstr.pt_fsc_code,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_trace_active" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_trace_active), input string(pt_mstr.pt_trace_active),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_trace_detail" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_trace_detail), input string(pt_mstr.pt_trace_detail),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_pm_mrp" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_pm_mrp), input string(pt_mstr.pt_pm_mrp),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ins_call_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ins_call_type, input pt_mstr.pt_ins_call_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ins_bom" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ins_bom, input pt_mstr.pt_ins_bom,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_ins_route" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_ins_route, input pt_mstr.pt_ins_route,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_promo" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_promo, input pt_mstr.pt_promo,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_meter_interval" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_meter_interval), input string(pt_mstr.pt_meter_interval),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_meter_um" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_meter_um, input pt_mstr.pt_meter_um,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_wh" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_wh), input string(pt_mstr.pt_wh),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_btb_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_btb_type, input pt_mstr.pt_btb_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_cfg_type" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_cfg_type, input pt_mstr.pt_cfg_type,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_app_owner" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_app_owner, input pt_mstr.pt_app_owner,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_op_yield" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_op_yield), input string(pt_mstr.pt_op_yield),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_run_seq1" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_run_seq1, input pt_mstr.pt_run_seq1,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_run_seq2" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_run_seq2, input pt_mstr.pt_run_seq2,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_atp_enforcement" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input wf_old_pt_mstr.pt_atp_enforcement, input pt_mstr.pt_atp_enforcement,
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

            when "pt_atp_family" then
                run CreateDthist(input dt_table, input dt_field, input dt_type, input string(wf_old_pt_mstr.pt_atp_family), input string(pt_mstr.pt_atp_family),
                    input recid(pt_mstr), input pt_mstr.pt_part, input "", input "", input "",
                    input "", input "", input "", input "").

        end.

    end.
end.

{hkdttrans.i}
